{
    "dataset_reader": {
      "class_name": "squad_dataset_reader",
      "dataset": "MultiSQuAD",
      "data_path": "{DOWNLOADS_PATH}/multi_squad/"
    },
    "dataset_iterator": {
      "class_name": "multi_squad_iterator",
      "seed": 1337,
      "shuffle": true,
      "with_answer_rate": 0.666
    },
    "chainer": {
      "in": [
        "context_raw",
        "question_raw"
      ],
      "in_y": [
        "ans_raw",
        "ans_raw_start"
      ],
      "pipe": [
        {
          "class_name": "torch_squad_transformers_preprocessor",
          "vocab_file": "{TRANSFORMER}",
          "do_lower_case": "{LOWERCASE}",
          "max_seq_length": 350,
          "return_tokens": true,
          "in": [
            "question_raw",
            "context_raw"
          ],
          "out": [
            "bert_features",
            "subtokens",
            "split_context"
          ]
        },
        {
          "class_name": "squad_bert_mapping",
          "do_lower_case": "{LOWERCASE}",
          "in": [
            "split_context",
            "bert_features",
            "subtokens"
          ],
          "out": [
            "subtok2chars",
            "char2subtoks"
          ]
        },
        {
          "class_name": "squad_bert_ans_preprocessor",
          "do_lower_case": "{LOWERCASE}",
          "in": [
            "ans_raw",
            "ans_raw_start",
            "char2subtoks"
          ],
          "out": [
            "ans",
            "ans_start",
            "ans_end"
          ]
        },
        {
          "class_name": "torch_transformers_squad:TorchTransformersSquad",
          "pretrained_bert": "{TRANSFORMER}",
          "checkpoint":"{MODEL_PATH}/model.cp",
          "save_path": "{MODEL_PATH}/model",
          "load_path": "{MODEL_PATH}/model",
          "optimizer": "AdamW",
          "optimizer_parameters": {
            "lr": 2e-05,
            "weight_decay": 0.01,
            "betas": [
              0.9,
              0.999
            ],
            "eps": 1e-06
          },
          "random_seed": 1,
          "learning_rate_drop_patience": 2,
          "learning_rate_drop_div": 2.0,
          "in": [
            "bert_features"
          ],
          "in_y": [
            "ans_start",
            "ans_end"
          ],
          "out": [
            "ans_start_predicted",
            "ans_end_predicted",
            "logits",
            "scores",
            "inds"
          ]
        },
        {
          "class_name": "squad_bert_ans_postprocessor",
          "in": [
            "ans_start_predicted",
            "ans_end_predicted",
            "split_context",
            "subtok2chars",
            "subtokens",
            "inds"
          ],
          "out": [
            "ans_predicted",
            "ans_start_predicted",
            "ans_end_predicted"
          ]
        }
      ],
      "out": [
        "ans_predicted",
        "ans_start_predicted",
        "scores"
      ]
    },
    "train": {
      "show_examples": false,
      "evaluation_targets": [
        "valid"
      ],
      "log_every_n_batches": 50,
      "val_every_n_batches": 500,
      "batch_size": 20,
      "valid_batch_size": 32,
      "pytest_max_batches": 2,
      "pytest_batch_size": 5,
      "validation_patience": 10,
      "metrics": [
        {
          "name": "squad_v1_f1",
          "inputs": [
            "ans",
            "ans_predicted"
          ]
        },
        {
          "name": "squad_v1_em",
          "inputs": [
            "ans",
            "ans_predicted"
          ]
        },
        {
          "name": "squad_v2_f1",
          "inputs": [
            "ans",
            "ans_predicted"
          ]
        },
        {
          "name": "squad_v2_em",
          "inputs": [
            "ans",
            "ans_predicted"
          ]
        }
      ],
      "class_name": "torch_trainer"
    },
    "metadata": {
      "variables": {
        "LOWERCASE": true,
        "TRANSFORMER": "bert-base-uncased",
        "ROOT_PATH": "/archive/evseev/.deeppavlov",
        "DOWNLOADS_PATH": "{ROOT_PATH}/downloads",
        "MODELS_PATH": "{ROOT_PATH}/models",
        "MODEL_PATH": "{MODELS_PATH}/multi_squad_torch_bert_noans/{TRANSFORMER}"
      },
    "download": [
      {
        "url": "http://files.deeppavlov.ai/v1/squad/model.cp",
        "subdir": "{MODEL_PATH}"
      }
    ]
    }
  }
